//
// Created by zhengjuping on 24-9-9.
//

#ifndef ENV_II_BT_GATTATTRIBUTETABLE_H
#define ENV_II_BT_GATTATTRIBUTETABLE_H


#include <esp_gatt_defs.h>
#include "BleUuid.h"
class GattAttribute{
public:
    GattAttribute(bool autoRsp,
                  const BleUuid& uuid,
                  uint16_t perm,
                  uint16_t max_length,
                  uint16_t length,
                  uint8_t *value);
    virtual ~GattAttribute();

    int32_t getGattsAttrDb( esp_gatts_attr_db_t &attr_db );

private:
    bool _autoRsp;
    BleUuid _bleUuid;
    uint16_t _perm;                     /*!< Attribute permission */
    uint16_t _max_length;               /*!< Maximum length of the element*/
    uint16_t _length;                   /*!< Current length of the element*/
    uint8_t  *_value;                   /*!< Element value array*/

    uint16_t _uuid16;
    uint32_t _uuid32;
    esp_gatts_attr_db_t _attr_db;
};


#endif //ENV_II_BT_GATTATTRIBUTETABLE_H
